<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<!DOCTYPE html>
<html>

<c:import url="/WEB-INF/module/head.jsp"/>

<body class="hold-transition skin-blue sidebar-mini" ng-app="blog" ng-controller="chapterSpecialController"
      ng-init="listInit()">

<!-- Content Header (Page header) -->
<section class="content-header">
    <h1>
        文章
        <small>全部</small>
    </h1>
    <ol class="breadcrumb">
        <li><a href="home.jsp"><i class="fa fa-dashboard"></i>首页</a></li>
        <li class="active">文章</li>
    </ol>
</section>

<!-- Main content -->
<section class="content container-fluid">

    <div class="box">
        <div class="box-header">
            <div class="row" id="records_handle_normal">
                <div class="col-lg-4 col-sm-6 col-xs-6">
                    <div class="input-group">
                        <input type="text" class="form-control" ng-model="keywords">
                        <span class="input-group-btn">
						  <button type="button" class="btn btn-primary btn-flat" ng-click="findPage()">搜索</button>
						</span>
                    </div>
                </div>
                <div class="col-lg-2 col-sm-2 col-xs-2">
                    <select ng-model="entity.isuse" ng-init="entity.isuse=''" class="form-control select2">
                        <option value="" selected>显示状态(全部)</option>
                        <option value="1">显示</option>
                        <option value="0">禁用</option>
                    </select>
                </div>
            </div>
            <div class="row">
                <div class="col-lg-12 col-md-12 col-sm-12 col-xs-12">
                    <a href="edit_chapter_special.jsp" class="btn btn-sm btn-success">添加</a>
                    <button type="button" class="btn btn-sm btn-success" ng-click="batchEditIsuse(1)">选中项启动</button>
                    <button type="button" class="btn btn-sm btn-warning" ng-click="batchEditIsuse(0, '确认禁用吗?')">选中项禁用
                    </button>
                    <button type="button" class="btn btn-sm btn-danger" ng-click="batchEditIsuse(2, '确认删除吗?')">选中项删除
                    </button>
                </div>
            </div>
        </div>
        <!-- /.box-header -->
        <div class="box-body">
            <table id="example1" class="table table-bordered table-striped">
                <thead>
                <tr>
                    <th style="width: 10px;">全选<input type="checkbox" class="js_checkbox"
                                                      ng-click="allIds($event, page.records)"></th>
                    <th>标题</th>
                    <th>索引</th>
                    <th>状态</th>
                    <th>可执行操作</th>
                </tr>
                </thead>
                <tbody>
                <tr ng-repeat="record in page.records">
                    <td class="text-center"><input type="checkbox" class="js_checkbox"
                                                   ng-click="updIds($event, record.id)"></td>
                    <td>{{record.title}}</td>
                    <td>{{record.name}}</td>
                    <td>
                        <small ng-show="record.isuse == 1" class="label bg-green">可用</small>
                        <small ng-show="record.isuse == 0" class="label bg-red">禁用</small>
                    </td>
                    <td>
                        <a class="btn btn-xs btn-primary" href="edit_chapter_special.jsp#?id={{record.id}}">修改</a>
                        <button ng-show="record.isuse != 1" type="button" class="btn btn-xs btn-success"
                                ng-click="editIsuse(record.id, 1)">启动
                        </button>
                        <button ng-show="record.isuse != 0" type="button" class="btn btn-xs btn-warning"
                                ng-click="editIsuse(record.id, 0, '确认禁用吗')">禁用
                        </button>
                        <button type="button" class="btn btn-xs btn-danger" ng-click="editIsuse(record.id, 2, '确认删除吗')">
                            删除
                        </button>
                    </td>
                </tr>
                </tbody>
            </table>
        </div>
        <!-- /.box-body -->
        <div class="box-footer clearfix">
            <ul class="pagination pagination-sm no-margin pull-right">
                <li ng-show="pageCtl.hasFirst"><a href="#">首页</a></li>
                <li ng-show="pageCtl.hasPrevious"><a href="#">&laquo;</a></li>
                <li ng-repeat="p in pageCtl.pageList" ng-class="pageCtl.current == p"><a href="#">{{p}}</a></li>
                <li ng-show="pageCtl.hasNext"><a href="#">&raquo;</a></li>
                <li ng-show="pageCtl.hasFinally"><a href="#">尾页</a></li>
            </ul>
        </div>
        <!-- /.box-body -->
    </div>
    <!-- /.box -->
</section>
<!-- /.content -->

<!-- ./wrapper -->

<!-- REQUIRED JS SCRIPTS -->
<c:import url="/WEB-INF/module/js.jsp"/>

</body>
</html>